<%@ page contentType="text/html; charset=UTF-8"%>
<style>
  .prog-border {
  height: 15px;
  width: 150px;
  background: #fff;
  border: 1px solid #000;
  margin: 0;
  padding: 0;
  }
  .prog-bar {
  height: 11px;
  margin: 2px;
  padding: 0px;
  background: #178399;
  font-size: 10pt;
  }
  </style>
	    <ww:form enctype="multipart/form-data" name="fileform" id="fileform" action="" method="post" target="target_upload">
		  <tr class="odd_mypm">
		  	 <td class="rightM_center" width="80">
		  	 附件:
		  	 </td>
		    <td class="dataM_left"  colspan="3" width="560">
				<input name="currUpFile" id="currUpFile" type="file" style="padding:2 0 0 4;width:210" cssClass="text_c">&nbsp;&nbsp;
				<img src="<%=request.getContextPath()%>/images/button/attach.gif" style="display:none"id="currAttach" alt="当前附件" title="打开当前附件" onclick="openAtta()" />
		    </td>
		  </tr>	
		  <tr class="ev_mypm">
		    <td width="80" align="right">&nbsp;</td>
			<td width="560" style="width:200;padding:2 0 0 4;" colspan="3"><div id="upStatusBar"></div></td>		  
		  </tr>		  
		  <tr  class="odd_mypm">
			<td class="dataM_center" align="center" width="640" colspan="4">
				<a class="bluebtn" href="javascript:void(0);"
					onclick="javascript:cW_ch.setModal(false);cW_ch.hide();"
					style="margin-left: 6px"><span> 返回</span> </a>
				<a class="bluebtn" href="javascript:void(0);" id="saveBtn"onclick="upLoadAndSub()"
					style="margin-left: 6px;display:none"><span> 确定</span> </a>
			<td>
	  </tr>	   
	  <tr class="ev_mypm">
	    <td colspan="4">&nbsp;</td>
	  </tr>	
	  </ww:form>		  
 		<iframe id='target_upload' name='target_upload' src=''style='display: none' ></iframe>
		</td>
		</tr>
	 </div>
	<script type="text/javascript">
	function statusChk(){
		var upPercent = "0";
	 	var ajaxRes = "";
	 	for(var i=0; i<2000;i++){
		}
		$('upStatusBar').innerHTML ="<div class=\"prog-border\"><div class=\"prog-bar\" style=\"width:5%\"></div></div>";
		while(loadStatus=="loadIng"){
			ajaxRest = postSub(conextPath+"/fileUpload?isAjax=true&cmd=chkUpLoad&upPercent="+upPercent,"");
			if(ajaxRest!=""&&ajaxRest.split("^")[0]!=upPercent){
				$('upStatusBar').innerHTML = ajaxRest.split("^")[1];
				if(ajaxRest.split("^")[0]=="100"){
					return;
				}
				if(upPercent=="0"||(ajaxRest!=""&&upPercent==ajaxRest.split("^")[0])){
					for(var i=0; i<20000;i++){
					}
				}
				upPercent= ajaxRest.split("^")[0];	
			}
		}
	}
	function stopStatusChk(message,saveFileName){
		if(message!="finish"){
			loadStatus="error";
				$('upStatusBar').innerHTML = "<div class='tdtxt'><font color='Red'>" + message + "</font></div>";
			eval("$('saveBtn').onclick  =upLoadAndSub");
			return;
		}
		loadStatus = "finish";
		$("attachUrl").value=saveFileName;
		$("upStatusBar").innerHTML ="<div class=\"prog-border\"><div class=\"prog-bar\" style=\"width:100%\"></div></div>";
		addUpSub("haveChk");
		eval("$('saveBtn').onclick  =upLoadAndSub");
	}
	function fileTypeChk(){
		var fileName = $("currUpFile").value;
		if(fileName.endWith(".exe")||fileName.endWith(".EXE")||fileName.endWith(".BAT")||fileName.endWith(".bat")
				||fileName.endWith(".sh")||fileName.endWith(".sh")
				||fileName.endWith(".jsp")||fileName.endWith(".js")
				||fileName.endWith(".htm")||fileName.endWith(".html")){
			return false;
		}else if(fileName.indexOf(".")<0){
			return false;
		}
		return true;			
	}
	</script>